using System;
using System.Collections.Generic;
using System.Text;
using PH.Common;

namespace Hoshimi
{
	public class NeedleGroup : Group
	{
		public override bool Add(Unit unit)
        {
            NeedleBot bot = (NeedleBot)unit;
			
		    // We affect a brain to the unit
		    bot.InitStateMachine( NeedleBotSMFactory.Instance() );

            return base.Add(unit);
        }

		/// <summary>
		/// Check the life of the unit
		/// </summary>
		/// <returns>Return true</returns>
		public override bool IsAlive()
		{
			base.IsAlive();

            return true;
		}

		public void DeclareNewNeedleBuild(BaseNeedle nanobot)
		{
			this.AskBot(BotTypeEnum.BaseNeedle);
			myStrategyManager.myCollectorGroup.AddBuiltNeedle(nanobot);
		}

		#region Ctor

        // Inhibate the default constructor
        protected NeedleGroup() { }

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="player">Environment</param>
		/// <param name="aFactory">Factory used to build the state machine</param>
		public NeedleGroup(Component myFather, AbstractSMFactory aFactory ) 
            : base(myFather, aFactory ) 
        {

        } 

        #endregion
	}
}
